home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / STRINGS / PACKAGE6 / CARDINAL.DOC next >
Text File  |  1990-07-25  |  1KB  |  39 lines

  1. -----------------------------------------------------------------------------
  2. ReadLnCardinal
  3. -----------------------------------------------------------------------------
  4.  
  5. declaration:       procedure ReadLnCardinal (var CardinalNumber:
  6.                                                    integer;
  7.                                              var LastKey:
  8.                                                    TypeKey);
  9.  
  10. purpose:           Reads in numbers allowing only 0..9, Escape, Enter,
  11.                    Backspace, and keeps a running tally of the number
  12.                    to prevent from exceeding MaxInt
  13.  
  14. pre-condition:     CardinalNumber is un-defined, LastKey is undefined
  15.  
  16. post-condition:    CardinalNumber is set to 0 if Escape is pressed, and
  17.                    keeps value if Enter is pressed
  18.  
  19. special cases:     none
  20.  
  21. example:           var Number:
  22.                          integer;
  23.                    var LastKey:
  24.                          TypeKey;
  25.  
  26.                    begin
  27.                      .
  28.                      .
  29.                      .
  30.                      ReadLnCardinal (Number, LastKey);
  31.                      if LastKey <> EscapeKey then
  32.                        write (output, Number);
  33.                      .
  34.                      .
  35.                      .
  36.                    end
  37.  
  38. -----------------------------------------------------------------------------
  39.